
<title>ReaLua</title>

<h1 style="text-align: center;"><img src="realua.png" alt="logo">ReaLua</img></h1>


<p>A <a href="http://www.lua.org/">Lua</a> implementation for
<a href="http://www.cockos.com/reaper/">REAPER</a>.</p>

<p>This is an embryonic index page.</p>

<p>This documentation is neither complete nor correct.
Use at your own risk.</p>

<h2>Contents</h2>

<p>(Some of these pages are just lists for now.)</p>

<dl>
	<dt><a href="map.html">Map</a></dt>
	<dd>Map of the ReaLua project.</dd>
</dl>

<dl>
	<dt><a href="reaper.functions.html"><code>reaper</code></a></dt>
	<dd>The functions in the main <code>reaper</code> table.</dd>
</dl>

<dl>
	<dt><a href="window.html">ReaLua Window</a></dt>
	<dd>How to operate the ReaLua Window to
	edit and execute Lua code.</dd>
</dl>


<dl>
	<dt><a href="examples.html">Examples</a></dt>
	<dd>Some stuff to get you going quickly.
	<code>dofile()</code> the <code>examples.lua</code>
	file to load these examples into ReaLua.</dd>
</dl>
<dl>
	<dt><a href="miscutil.html">Miscellaneous and Utility Functions</a></dt>
	<dd>Summary of <a href="window.html">ReaLua Window</a>-realated functions.</dd>
	<dd>Summary of Utility functions in the main
	<a href="reaper.functions.html"><code>reaper</code></a>
	table.</dd>
</dl>

<dl>
	<dt><a href="reaper.mediatrackinfo.html">Media <b>Track</b> Info Table</a></dt>
	<dd>Summary of the <code>reaper.MediaTrackInfo</code> table.
	Use this to manipulate the Tracks in Reaper.</dd>
</dl>

<dl>
	<dt><a href="reaper.mediaiteminfo.html">Media <b>Item</b> Info Table</a></dt>
	<dd>Summary of the <code>reaper.MediaItemInfo</code> table.
	Use this to manipulate the Media Items in the Tracks in Reaper.</dd>
</dl>

<dl>
	<dt><a href="reaper.mediaitemtakeinfo.html">Media <b>Item Take</b> Info Table</a></dt>
	<dd>Summary of the <code>reaper.MediaItemTakeInfo</code> table.
	Use this to manipulate the Takes in the Media Items in the Tracks in Reaper.</dd>
</dl>
<dl>
	<dt><a href="reaper.tracksendinfo.html"><b>Track Send</b> Info Table</a></dt>
	<dd>Use this to manipulate the sends for a track.</dd>
</dl>
<dl>
	<dt><a href="pcm_source.html">PCM_source Objects</a></dt>
	<dd>What you can do with these C++ objects bridged with ReaLua</dd>
</dl>
<dl>
	<dt><a href="pcm_sink.html">PCM_sink Objects</a></dt>
	<dd>What you can do with these C++ objects bridged with ReaLua</dd>
</dl>
<dl>
	<dt><a href="midi_input.html">midi_Input Objects</a></dt>
	<dd>What you can do with these C++ objects bridged with ReaLua</dd>
</dl>
<dl>
	<dt><a href="midi_output.html">midi_Output Objects</a></dt>
	<dd>What you can do with these C++ objects bridged with ReaLua</dd>
</dl>
<dl>
	<dt><a href="midi_eventlist.html">MIDI_eventlist Objects</a></dt>
	<dd>What you can do with these C++ objects bridged with ReaLua</dd>
</dl>
<dl>
	<dt><a href=""></a></dt>
	<dd></dd>
</dl>
<dl>
	<dt><a href=""></a></dt>
	<dd></dd>
</dl>
<dl>
	<dt><a href=""></a></dt>
	<dd></dd>
</dl>
<dl>
	<dt><a href=""></a></dt>
	<dd></dd>
</dl>
<dl>
	<dt><a href=""></a></dt>
	<dd></dd>
</dl>
<dl>
	<dt><a href=""></a></dt>
	<dd></dd>
</dl>
<dl>
	<dt><a href=""></a></dt>
	<dd></dd>
</dl>

<h2>What It Is</h2>

<p>
ReaLua is an attempt to expose the
Reaper API to the Lua programming language.
</p>
<p>
The aim is to provide Reaper with Lua scriptability.
</p>
<p>
All other considerations have been tossed aside,
sacrificed to the aim of scriptability.
</p>

<p>ReaLua is also a collection of guesses.  I am
certain that I have misinterpreted the Reaper API
in several places.</p>

<h2>What It Is Not</h2>

<p>It is not a replacement for C.</p>

<p>But it can be used to explore the Reaper
Extension API interactively, so it can help you
write your C extensions.</p>

<h2>How To Work It</h2>

<p>
Stick the <code>.dll</code> in your Reaper
plugin directory.  Fire up Reaper.  Mash
<code>ALT-0</code> (alt zero).  The
<a href="window.html">ReaLua Window</a>
will open.
</p>

<p><img src="window.jpg" alt="ReaLua Window"></img></p>

<p>
Do your Lua in the Input Area, which is to the right
of the Prompt Area and under the Output Area.  Try
<code>print(reaper)</code> to get started.  To send
your lines to the Lua interpreter, press
<code>CTRL-Enter</code> (control enter).
</p>
<p>
When you
want to get back to Reaper, simply close the ReaLua Window
or call the global function <code>exit()</code>
to leave the ReaLua window under program control.
</p>
<p>
The Reaper API is presented through a table
in the global namespace named <code><a href="reaper.functions.html">reaper</a></code>.
</p>
<p>
Other types and objects are created through
<a href="reaper.functions.html">the functions in this table</a>.
</p>
<p>
<a href="map.html">This map</a> shows more detail how to get at the
Reaper API through this main table and its buddies.
</p>

<h2>Contact</h2>

<p>The ReaLua project email address is
<a href="mailto:reaper.lua@gmail.com">reaper.lua@gmail.com</a>,
please send scripts, bug reports, feature and script requests, questions,
suggestions, and employment offers.</p>


<h2>We Seek Peaceful Co&euml;xistence</h2>

<p>
Install <a href="http://luaforwindows.luaforge.net/">Lua for Windows</a>.
</p>

<p>
Point your LUA_PATH and so forth at its libraries.
</p>

<p>
You can load many of the libraries.  Silly conflicts
prevent all of them from being loadable.
</p>

<p>
Very useful are
</p>

<p>

<p><code>require("std")</code></p>
<p><code>require("base")</code></p>
<p><code>require("lfs")</code></p>

<p>And wxWidgets works<big>!!!</big>, but crashes upon Reaper
quit (very likely a War of Civilizations between
Lua memory management and C++ memory management).
</p>

<p>
<code>dofile("w:\\realua\\trunk\\examples.lua")</code><br>
<code>ShowTracksTable()</code>
</p>
<p>
Will show an HTML window wxWidget of your tracks, if all goes well.
It is not a proper wxWidgets program, and the window cannot
be closed, and Reaper will crash when you quit, but hey it might work
for you!
</p>

